#include "waitingroom.h"
#include "ui_waitingroom.h"

waitingroom::waitingroom( QString username, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::waitingroom)
{
    ui->setupUi(this);
    this->name = username;
    QPalette palette;
    QPixmap backgroundImage(":/images/waiting.png");
    this->setFixedSize(900, 600);
    backgroundImage = backgroundImage.scaled(this->size(), Qt::IgnoreAspectRatio);
    palette.setBrush(QPalette::Window, backgroundImage);
    this->setPalette(palette);
    this->setAutoFillBackground(true);

}

waitingroom::~waitingroom()
{
    delete ui;
}

void waitingroom::setPlayer(int select, QString username)
{
    if(select == 1)
    {
        ui->ZombiePlayer->setText(username);
    }
    else{
        ui->PlantPlayer->setText(username);
    }
}

